<%@ page import="java.time.LocalDateTime" %>
<%@ page import="java.time.format.DateTimeFormatter" %>
<%--
  Created by IntelliJ IDEA.
  User: 罗诚
  Date: 2024/11/18
  Time: 下午8:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page  contentType="text/html;charset=UTF-8" language= "java" %>

<html>
<head>
    <title>Title</title>
    <link href="static/css/index.css" rel="stylesheet" >
</head>
<style>
    .title {


        position: relative;

    }
    .ten {
        float: left;
        width: 500px;
        height: 1px;

    }

.bbbb {
    margin-top: 300px;
    margin-left: 150px;
    margin-bottom: 400px;
}
.cccc{
    margin-top: 300px;
    margin-left: 50px;
}
.dddd{
    margin-left: 50px;
}
.eeee{
    margin-left: 50px;
}
.ffff{
    margin-left: 50px;
}
.aaaa{
    margin-top: 100px;
    margin-left: 50px;
}
.hh{

    margin-left:65px;
}
</style>
<body>
<%@include file="head.jsp"%>
<%
    // 获取当前时间并格式化
    LocalDateTime now = LocalDateTime.now();
    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    String formattedTime = now.format(formatter);
%>
<div class="ten">
            <p class="title"></p>
    <p class="aaaa"><input type="text"placeholder="请输入搜索内容"  >
        <button>搜索</button></p>

            <%
                if(session.getAttribute("customerId") == null){
            %>

            <p class="bbbb">请登录</p>
            <%
            }else{
            %>
          <div class="hh">
            <p class="cccc">登录成功</p>
            <p>当前的时间是:<%=formattedTime%></p>
            <p class="eeee">用户姓名：<%=session.getAttribute("username")%></p>
    <p class="ffff"> <button ><a href="login.jsp">安全退出</a></button></p>
          </div>
            <%
                }
            %>
    </div>


        <%@include file="product_list.jsp"%>
    

<%@include file="footer.jsp"%>
</body>
</html>